using System;
using SpecificationPatternCodeV2.Abstracts;

namespace SpecificationPatternCodeV2.Base
{
	public class GreaterThanOrEqualToSpecification<T> : CompositeSpecification<T> where T : IComparable<T>
	{
		private readonly T _lower;

		public GreaterThanOrEqualToSpecification(T lower)
		{
			_lower = lower;
		}

		public override bool IsSatisfiedBy(T candidate)
		{
			return candidate.CompareTo(_lower) >= 0;
		}
	}
}